<?php
//SELECT @a:=k.`id_key` FROM `keys` k , `translation` t WHERE k.`id_key` = t.`id_key` AND t.`id_lang` =1 AND k.`id_projet` =1 GROUP BY t.`translation`;
//SELECT * FROM `keys` k WHERE k.`id_key` IN (@a);
session_start();
if(!isset($_SESSION['babili']['gid']) || $_SESSION['babili']['gid']!=3 ) die("You are not authorized to access!");
require_once "../includes/configure.php";

//Connexion à la base de données
$connect = mysql_connect(DB_SERVEUR,DB_USER,DB_PASS);
@mysql_query("SET NAMES 'utf8'");
@mysql_query("SET CHARACTER SET utf8");
mysql_select_db(DB_BDD) or die("erreur de connexion a la base de donnees");

$nb_occur=3000000;
$time_start = microtime(true);

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- Made By D.Wassim : wdammak@talend.com -->
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Administration <?=BABILI_COMPANY?> Babili / Synchronization</title>
	<meta name="description" content="With <?=BABILI_COMPANY?> Babili, Community members can translate the user interface of <?=BABILI_COMPANY?>'s products in any language." />
	<link rel="stylesheet" href="<?php echo BABILI_URL; ?>/admin/css/general.css" type="text/css" />
	<META NAME="Author" CONTENT="Wassim DAMMAK">
</head>
<body>
<div id="header">
	<?php include("../includes/header.php");  ?> 
</div>
<?php /*
<div id="navcol">
	<?php require_once("includes/navleft.php"); ?>    
</div>

<div id="sidecol">
	<?php require_once("includes/navright.php"); ?>
</div>
*/
?>
<input src="img/back.gif" name="back" id="btnBack" value="Back" onclick="location.href='index.php'" type="image" />
<div id="main">
	<p>&nbsp;</p>
	<?php 
		if(isset($_GET['list']) || isset($_POST['list']) ){
			require_once("includes/synchronization.php");
			echo "<br/>end.<br/>";
		}else{
			$list_lang="SELECT id_lang, name FROM languages WHERE id_lang!=1";
			$result=mysql_query($list_lang);
			$datas_lang=array();
			while ($row = mysql_fetch_assoc($result)) {
				array_push(
					$datas_lang,
					array(
						'id_lang' => $row['id_lang'],
						'name' =>$row['name'],
					)
				);
			}
			?>
			<form method="post">
				Please select langue:&nbsp;			
				<select id="list" name="list">
				<?php 
					foreach($datas_lang as $ln){
						echo '<option value="'.$ln['id_lang'].'" '.(($_POST['']==$ln['id_lang'])?'selected="selected"':'').'>'.$ln['name'].'</option>';
					}
					echo '<option value="all" selected="selected">ALL</option>';
				?>
				</select><br />
				<input type="submit" name="start" value="Submit" />	
			</form>
	<?php } ?>
	
	<p>&nbsp;</p>
</div>
<?php 
	$time_end = microtime(true);
	$time = $time_end - $time_start;
	printf("<p align=\"center\"><span class=\"generatedPage\">Page generated in: %1\$.2f sec.</span><br /></p>",$time);
?>
<div id="footer">
	<?php require_once("../includes/footer.php"); ?>       
</div>

</body>
</html>